﻿@model ICDA.Web.Models.LeaveModel
@{
    ViewBag.Title = "Leave";
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#LeaveStartDate").datepicker
            ({
                beforeShowDay: $.datepicker.noWeekends,
                dateFormat: 'mm/dd/yy',
                showStatus: true,
                showWeeks: true,
                highlightWeek: true,
                numberOfMonths: 1,
                showAnim: "scale",
                showOptions: {
                    origin: ["top", "left"]
                }
            });
        $("#LeaveEndDate").datepicker
            ({
                beforeShowDay: $.datepicker.noWeekends,
                onSelect: function (date) {
                    var sdate = $("#LeaveStartDate").val();
                    if (sdate > date) {
                        alert("Leave End date cant be less than Start date");
                        $("#LeaveEndDate").focus();
                    }
                },
                dateFormat: 'mm/dd/yy',
                showStatus: true,
                showWeeks: true,
                highlightWeek: true,
                numberOfMonths: 1,
                showAnim: "scale",
                showOptions: {
                    origin: ["top", "left"]
                }
            });
    }); 
</script>
<div class="tabscontainer">
    <div class="tabs">
        <div class="tab first" id="tab_menu_1">
            <div class="link">@Html.ActionLink("Leave Apply", "LeaveApply", "Leave")</div>
            <div class="arrow">
            </div>
        </div>
        <div class="tab" id="tab_menu_2">
            <div class="link">@Html.ActionLink("View Leave", "ViewLeave", "Leave")</div>
            <div class="arrow">
            </div>
        </div>
        <div class="tab selected last" id="tab_menu_3">
            <div class="link">@Html.ActionLink("Edit Leave", "LeaveEdit", "Leave")</div>
            <div class="arrow">
            </div>
        </div>
    </div>
    <div class="curvedContainer">
        <div class="tabcontent" id="tab_content_1" style="display: block">
            @using (Html.BeginForm())
            {
                @Html.ValidationSummary(true, "")
                <div class="MainContent">
                    <div class="formcontainer">
                        <div class="formtr">
                            <div class="formlabes">
                                @Html.LabelFor(m => m.LeaveStartDate)
                            </div>
                            <div class="formfield">
                                @Html.TextBoxFor(m => m.LeaveStartDate)
                            </div>
                            <div class="messageRow">
                                @Html.ValidationMessageFor(m => m.LeaveStartDate)
                            </div>
                        </div>
                        <div class="formtr">
                            <div class="formlabes">
                                @Html.LabelFor(m => m.LeaveEndDate)
                            </div>
                            <div class="formfield">
                                @Html.TextBoxFor(m => m.LeaveEndDate)
                            </div>
                            <div class="messageRow">
                                @Html.ValidationMessageFor(m => m.LeaveEndDate)
                            </div>
                        </div>
                        <div class="formtr">
                            <div class="formlabes">
                                @Html.LabelFor(m => m.LeaveType)
                            </div>
                            <div class="formfield">
                                @Html.RadioButtonFor(m => m.LeaveType, false) Training
                                @Html.RadioButtonFor(m => m.LeaveType, true) Leave
                            </div>
                            <div class="messageRow">
                                @Html.ValidationMessageFor(m => m.LeaveType)
                            </div>
                        </div>
                        <div class="formtr DayType">
                            <div class="formlabes">
                                @Html.LabelFor(m => m.DayType)
                            </div>
                            <div class="formfield">
                                @Html.RadioButtonFor(m => m.DayType, true) Full Day
                                @Html.RadioButtonFor(model => model.DayType, false) Half Day
                            </div>
                            <div class="messageRow">
                                @Html.ValidationMessageFor(m => m.DayType)
                            </div>
                        </div>
                        <div class="formtr">
                            <div class="formlabes">
                                @Html.LabelFor(m => m.LeaveName)
                            </div>
                            <div class="formfield">
                                @Html.TextBoxFor(m => m.LeaveName)
                            </div>
                            <div class="messageRow">
                                @Html.ValidationMessageFor(m => m.LeaveName)
                            </div>
                        </div>
                        <div style="height: 6px; float: left; width: 100%;">
                        </div>
                        <div class="formEditButton">
                            <button name="actionType" type="submit" class="button orange medium" value="Submit">
                                Submit</button>
                            <button name="actionType" type="submit" class="button orange medium" value="Cancel">
                                Cancel</button>
                        </div>
                    </div>
                </div>
            }
        </div>
    </div>
</div>
